<template>
    <div class="home">
        <lineChart :xdata="xdata" :ydata="ydata"></lineChart>
    </div>
</template>

<script>
import lineChart from '@/components/line/lineChart.vue'

import { ordertotaldataReq } from '@/api/account.api'
export default {
    components: { lineChart },

    data() {
        return {
            xdata: [],
            ydata: []
        }
    },
    created() {
        ordertotaldataReq().then(res => {
            this.xdata = res.data.xData
            this.ydata = [{
                name: '订单',
                data: res.data.orderData
            },
            {
                name: '销售额',
                data: res.data.amountData
            },

            ]
            // this.getEchartData()
        })
    },
}
</script>

<style lang="less" scoped>
.home {
    // width: 500px;
    // height: 500px;
    height: 100%;
    background-color: #fff;
}
</style>